package com.ruoyi.project.price.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.price.mapper.BinsPriceRuleMapper;
import com.ruoyi.project.price.domain.BinsPriceRule;
import com.ruoyi.project.price.service.IBinsPriceRuleService;

/**
 * 价格规则Service业务层处理
 * 
 * @author administrator
 * @date 2025-04-02
 */
@Service
public class BinsPriceRuleServiceImpl implements IBinsPriceRuleService 
{
    @Autowired
    private BinsPriceRuleMapper binsPriceRuleMapper;

    /**
     * 查询价格规则
     * 
     * @param id 价格规则主键
     * @return 价格规则
     */
    @Override
    public BinsPriceRule selectBinsPriceRuleById(Long id)
    {
        return binsPriceRuleMapper.selectBinsPriceRuleById(id);
    }

    /**
     * 查询价格规则列表
     * 
     * @param binsPriceRule 价格规则
     * @return 价格规则
     */
    @Override
    public List<BinsPriceRule> selectBinsPriceRuleList(BinsPriceRule binsPriceRule)
    {
        return binsPriceRuleMapper.selectBinsPriceRuleList(binsPriceRule);
    }

    /**
     * 查询价格规则列表
     *
     * @param binsPriceRule 价格规则
     * @return 价格规则
     */
    @Override
    public BinsPriceRule selectBinsPriceRule(BinsPriceRule binsPriceRule)
    {
        return binsPriceRuleMapper.selectBinsPriceRule(binsPriceRule);
    }

    /**
     * 新增价格规则
     * 
     * @param binsPriceRule 价格规则
     * @return 结果
     */
    @Override
    public int insertBinsPriceRule(BinsPriceRule binsPriceRule)
    {
        binsPriceRule.setCreateTime(DateUtils.getNowDate());
        return binsPriceRuleMapper.insertBinsPriceRule(binsPriceRule);
    }

    /**
     * 修改价格规则
     * 
     * @param binsPriceRule 价格规则
     * @return 结果
     */
    @Override
    public int updateBinsPriceRule(BinsPriceRule binsPriceRule)
    {
        binsPriceRule.setUpdateTime(DateUtils.getNowDate());
        return binsPriceRuleMapper.updateBinsPriceRule(binsPriceRule);
    }

    /**
     * 批量删除价格规则
     * 
     * @param ids 需要删除的价格规则主键
     * @return 结果
     */
    @Override
    public int deleteBinsPriceRuleByIds(Long[] ids)
    {
        return binsPriceRuleMapper.deleteBinsPriceRuleByIds(ids);
    }

    /**
     * 删除价格规则信息
     * 
     * @param id 价格规则主键
     * @return 结果
     */
    @Override
    public int deleteBinsPriceRuleById(Long id)
    {
        return binsPriceRuleMapper.deleteBinsPriceRuleById(id);
    }
}
